package hu.bme.aut.consulttime.server.entities;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
@Entity
public class ToDo implements Serializable {
	
	private static final long serialVersionUID = 7L;
	
	@Id
	@GeneratedValue
	private long todoId;

	private String title;
	
	@Temporal(TemporalType.TIMESTAMP)
	private Date date; 
	
	private int week;
	private String description;

	// Reference to Student
	@ManyToOne
	@JoinColumn(name = "studentId")
	private Student student;
	
	@ManyToOne
	@JoinColumn(name = "teamId")
	private Team team;

	// Reference to Tutor
	@ManyToOne
	@JoinColumn(name = "tutorId")
	private Tutor tutor;

	// Reference to Evaluation
	@OneToOne(mappedBy = "toDo", cascade = CascadeType.REMOVE)
	private Evaluation evaluation;

	// Reference to Log
	@OneToMany(mappedBy = "toDo", cascade = CascadeType.REMOVE)
	private List<Log> uploadedLogs = new ArrayList<Log>();

	public long getTodoId() {
		return todoId;
	}

	public void setTodoId(long todoId) {
		this.todoId = todoId;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public Date getDate() {
		return date;
	}

	public void setDate(Date date) {
		this.date = date;
	}

	public int getWeek() {
		return week;
	}

	public void setWeek(int week) {
		this.week = week;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Student getStudent() {
		return student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	public Team getTeam() {
		return team;
	}

	public void setTeam(Team team) {
		this.team = team;
	}

	public Tutor getTutor() {
		return tutor;
	}

	public void setTutor(Tutor tutor) {
		this.tutor = tutor;
	}

	public Evaluation getEvaluation() {
		return evaluation;
	}

	public void setEvaluation(Evaluation evaluation) {
		this.evaluation = evaluation;
	}

	public List<Log> getUploadedLogs() {
		return uploadedLogs;
	}

	public void setUploadedLogs(List<Log> uploadedLogs) {
		this.uploadedLogs = uploadedLogs;
	}

}
